package cn.edu.qut.edusys.controller;

import cn.edu.qut.edusys.mapper.StudentMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/student")
public class studentController {

    @Resource
    StudentMapper studentMapper;
//查询考试信息
    @RequestMapping("/search")
    public List<Map<String,Object>> search(@RequestParam Map<String,String> param){
        List<Map<String,Object>> list=null;
        list=studentMapper.search(param);
        return list;
    }

// 查询考试成绩
    @RequestMapping("/search1")
    public List<Map<String,Object>> search1(@RequestParam Map<String,String> param){
        List<Map<String,Object>> list=null;
        list=studentMapper.search1(param);
        return list;
    }

    @RequestMapping("/finished")
    List<Map<String,Object>> finished(String id) {
        return studentMapper.finished(id);
    }

    @RequestMapping("/unfinished")
    List<Map<String,Object>> unfinished(String id) {
        return studentMapper.unfinished(id);
    }

    @RequestMapping("/submit")
    int submit(@RequestParam Map<String,String> param) {
        int row=0;
        row=studentMapper.submit(param);
        return row;
    }
}
